<!--#include file="pj.asp"-->
<!DOCTYPE html>
<html>
<head>
<%
  easp.include "h.asp"
  'Easp.Db.Del "[baseinfo]","mode='upf_1'"
  vas "allow_upf_1","zip|rar|7z|pdf|qes|txt|sql|csv|chm"
%>
  <style type="text/css">
    .layui-upload-drag {
      display: block;
      margin: 10px 20px;
    }
  </style>
  <title>上传示例1</title>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card"><br>
		<div class="layui-upload-drag" id="test10">
      <i class="layui-icon"></i>
      <p>点击上传，或将文件拖拽到此处（支持 <%echo replace(val("allow_upf_1"),"|"," ") %> ）</p>
	  </div>
    <div class="layui-progress" id="demo" lay-filter="demo">
      <div class="layui-progress-bar" ></div>
    </div>
	<br>
        <div class="layui-card-body">
              <dl class="layuiadmin-card-status">
                <%
                  dim i,arr,title_
                  hi "page",val("page")
                  hi "upf_1_count",""
                %>
              </dl> 
		</div>
  </div>
  <script src="/dzps/src/layuiadmin/layui/layui.js"></script> 
  <script>
  layui.config({
    base: '/dzps/src/layuiadmin/' 
  }).extend({
    index: 'lib/index'
    ,mymod: '../../yx/js/mymod' 
 
  }).use(['element', 'mymod','index', 'useradmin','upload','table'], function(){
    var $ = layui.$,form = layui.form,admin = layui.admin,upload = layui.upload,table=layui.table,laypage = layui.laypage,mymod = layui.mymod,element = layui.element;
  var fn='';
  $("#demo").hide(); 
  upload.render({
    elem: '#test10'
    ,url: location.protocol+'//'+location.host+'/dzps/yx/up_t_content.asp?now=' + new Date().getTime()
    ,accept: 'file' //普通文件
    ,exts:'<%=val("allow_upf_1")%>'  //允许上传
    ,before: function(obj){ 
    obj.preview(function(index, file, result){
      fn=file.name;
      $("#demo").show(); 
    });
    }
  ,error: function(index, upload){
      $("#demo").hide();  
  }    
 ,progress: function(n, elem, res, index){
    var percent = n + '%' 
    element.progress('demo', percent); 
    element.progress('demo', n + '%'); //进度条
  }
    ,done: function(res){
      if(res.code == 0){      //code=0代表上传成功
        layer.msg('上传成功！！|'+ res.msg); 
        $.post('pj.asp?now=' + new Date().getTime(), {
							action: "upf_1_add",name1:res.msg,name2:fn,name3:"<%=Format_Time(now(),1)%>"
						},
						function(data) {
							var jsonObj = $.parseJSON(data);
						});
            mymod.l_data("<%=Easp.Db.PageSize%>");  
            $("#demo").hide();      
      }
    }
  });
  mymod.l_data("<%=Easp.Db.PageSize%>");
  });
  </script>
</body>
</html>